How can an application program (such as main()) change the balance of a CheckingAccount object?

A good answer might be:

By using the methods such as processDeposit() and processCheck() that have been written for that purpose.

Access Methods

A class with private data controls access to that data by using access methods. An access method is a method which uses the private data of its class and is visible to other classes . Some access methods alter data; others return a value but don't alter data. Here is a main() that uses the access methods of the CheckingAccount object bobsAccount.

class CheckingAccount
{
  private String accountNumber;
  private String accountHolder;
  private int    balance;
  . . . .
}

class CheckingAccountTester
{
  public static void main( String[] args )
  {
    CheckingAccount bobsAccount = new CheckingAccount( "999", "Bob", 100 );

    System.out.println( bobsAccount.currentBalance() );
    bobsAccount.processDeposit( 200 );
    System.out.println( bobsAccount.currentBalance() );

  }
}

(If you want to run this program, copy and paste from the previous page and this page into Notepad.)

QUESTION 3:

What access methods are used in main()?